//
//  SmsCloudHead.m
//  smsCloud
//
//  Created by 吴斌 on 2024/7/17.
//

#import "SmsCloudHead.h"
@implementation SmsCloudHead
+ (CGFloat)SmsCloudScreewWidth{
    return [UIScreen mainScreen].bounds.size.width;
}
+ (CGFloat)SmsCloudScreewHight{
    return [UIScreen mainScreen].bounds.size.height;
}
+ (CGFloat)SmsCloudScreewRatio:(CGFloat)value{
    return [self SmsCloudScreewWidth] * value/750;
}
+ (BOOL)IsSmsCloudLiuHai{
    BOOL isLiuHai = NO;
    isLiuHai = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom > 0.0;
    return isLiuHai;
}
+ (CGFloat)SmsCloudHeadStateHight{
    return [UIApplication sharedApplication].windows.firstObject.windowScene.statusBarManager.statusBarFrame.size.height;
}
//+ (CGFloat)SmsCloudBottomTabBarHight{
//    return [self IsSmsCloudLiuHai] ? 83 : 39;
//}
+ (CGFloat)SmsCloudTopSafeH{
    return [self IsSmsCloudLiuHai] ? 44 : [self SmsCloudHeadStateHight];
}
//+ (CGFloat)SmsCloudBottomSafeH{
//    return [self IsSmsCloudLiuHai] ? 34 : 0;
//}
+ (UIImage *)SmsCloudImageNamed:(NSString *)imgName{
    return [UIImage imageNamed:imgName];
}
+ (UIColor *)SmsCloudColorHexString:(NSString *)colorHex withAlpha:(CGFloat)alpha{
    unsigned rgbValue = 0;
    colorHex = [colorHex stringByReplacingOccurrencesOfString:@"#" withString:@""];
    [[NSScanner scannerWithString:colorHex] scanHexInt:&rgbValue];
    return [UIColor colorWithRed:((rgbValue & 0xFF0000) >> 16)/255.0 green:((rgbValue & 0xFF00) >> 8)/255.0 blue:(rgbValue & 0xFF)/255.0 alpha:alpha];
}
+ (UIColor *)SmsCloudColorHexString:(NSString *)colorHex{
    return [self SmsCloudColorHexString:colorHex withAlpha:1.0];
}
+ (NSString *)SmsCloudPublicForUserAg{
    return @"https://lgg69az5eh.feishu.cn/docx/CWiod1WkWot2nxxF6j9c7u1Knjb?from=from_copylink";
}
+ (NSString *)SmsCloudPublicForPriAg{
    return @"https://lgg69az5eh.feishu.cn/docx/NFmzdMzKAo8rPFxyZ7sc4VOmnth?from=from_copylink";
}
+ (NSString *)SmsCloudUrlSandboxUrl{
    return @"https://sandbox.itunes.apple.com/verifyReceipt";
}
+ (NSString *)SmsCloudPublicAppBundId{
    return @"com.cc.yaoyao";
}
+ (NSString *)SmsCloudPublicAppProductId{
    return @"kankannianhuiyuan";
}
+ (NSString *)SmsCloudPublicAppProductKey{
    return @"b93e9d9edffb49549cf7a94bd6d1430a";
}
+ (NSString *)SmsCloudUrlVipPrice{
    return @"http://guoqi-sms.neighbor.icu/lbbserves/api/appdingyue/info";
}
+ (NSString *)SmsCloudUrlMD{
    return @"http://guoqi-sms.neighbor.icu/lbbmajiabao/api/maidian";
}
+ (NSString *)SmsCloudProductList{
    return @"https://guoqi-smsv3.neighbor.icu/serveall/api/sms/productList";
}
+ (NSString *)SmsCloudCityList{
    return @"https://guoqi-smsv3.neighbor.icu/serveall/api/sms/getTopCountriesByService";
}
+ (NSString *)SmsCloudRedomPhone{
    return @"https://guoqi-smsv3.neighbor.icu/serveall/api/sms/getNumber";
}
+ (NSString *)SmsCloudPhoneCode{
    return @"https://guoqi-smsv3.neighbor.icu/serveall/api/sms/getActiveActivations";
}
+ (BOOL)isSmsCloudVip{
    NSTimeInterval smsCloudVipBuyTime = (NSTimeInterval)[[NSUserDefaults standardUserDefaults] doubleForKey:@"smsCloudVipBuyTime"];
    NSTimeInterval smsCloudCurrentTime = [[NSDate date] timeIntervalSince1970];
    if(!smsCloudVipBuyTime||(smsCloudVipBuyTime <= smsCloudCurrentTime)){
        return false;
    }else{
        return true;
    }
}
@end
